<?php
namespace app\validate;

use think\Validate;

class CheckUser extends Validate
{
    protected $rule =   [
        'role_id'  => 'require',
        'givenname'  => 'require|length:1,20|token|alpha',
        'surname'  => 'require|length:1,20|alpha',
        'email'  => 'require|email',

    ];

    protected $message  =   [
        'role_id.require' => '请选择角色！',
        'givenname.require' => '名不能为空！',
        'givenname.length' => '名长度不能超过20个字符！',
        'givenname.alpha' => '名只可为字母！',
        'surname.require' => '姓不能为空！',
        'surname.length' => '姓长度不能超过20个字符！',
        'surname.alpha' => '姓只可为字母！',
        'email.require' => '邮箱不能为空！',
        'email.email' => '请输入正确的邮箱！',
    ];

}